home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Magazin/MacEasy 24
/
Mac Magazin and MacEasy Magazine CD - Issue 24.iso
/
Grafik & Text
/
Microsoft Installer Patch
/
main.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-13
|
841b
|
54 lines
#include <A4Stuff.h>
#include "patches.h"
#include "notify.h"
// this is really ugly...
#define CAPS_KEY_IS_DOWN (*(Byte*)(0x17b)&2)
// globals
Str63 volumeName;
short volumeVRef;
void main(void)
{
Handle me;
StringHandle notifyString;
EnterCodeResource();
// abort condition
if ( CAPS_KEY_IS_DOWN ) goto done;
// get the name of the startup volume, which should be our default volume
GetVol( volumeName, &volumeVRef );
// detach ourselves, because our helper routine will be getting called
me = Get1Resource( 'INIT', 128 );
if (!me) goto done;
// make sure we're locked up tight
DetachResource(me);
HLock(me);
HNoPurge(me);
PatchFSDispatch();
// inform the user that we're installed
notifyString = GetString( 128 );
if (notifyString) UserNotify( *notifyString );
done:
ExitCodeResource();
}